import request from '@/utils/request'

export function listOrder(query) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.order',
      _mt: 'list',
      ...query
    }
  })
}

export function detailOrder(orderId = '', orderNo = '') {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.order',
      _mt: 'detail',
      orderId,
      orderNo
    }
  })
}

export function shipOrder(shipForm) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.order',
      _mt: 'ship',
      ...shipForm
    }
  })
}

export function refundOrder(refundForm) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.order',
      _mt: 'refund',
      ...refundForm
    }
  })
}

export function customRefundOrder(customRefundForm) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.order',
      _mt: 'customRefund',
      ...customRefundForm
    }
  })
}

export function getExcelInfo(data) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.order',
      _mt: 'queryToExcel',
      ...data
    }
  })
}

export function getExcelStatistics(data) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.order',
      _mt: 'statistics',
      ...data
    }
  })
}

export function editAdminMono(orderId, level, mono) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.order',
      _mt: 'editAdminMono',
      orderId,
      level,
      mono
    }
  })
}

export function waitStockOrderNos() {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.order',
      _mt: 'waitStockOrderNos'
    }
  })
}

export function statisticsMoney(gmtDay) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.order',
      _mt: 'moneyStatistics',
      gmtDay
    }
  })
}

